\(\int \frac {x^2 (a+b \log (c (d+e x)^n))}{(f+g x)^2} \, dx\) [250]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [C] (warning: unable to verify)
   Fricas [F]
   Sympy [F]
   Maxima [F]
   Giac [F]
   Mupad [F(-1)]

Optimal result

Integrand size = 25, antiderivative size = 186 \[ \int \frac {x^2 \left (a+b \log \left (c (d+e x)^n\right )\right )}{(f+g x)^2} \, dx=\frac {a x}{g^2}-\frac {b n x}{g^2}+\frac {b e f^2 n \log (d+e x)}{g^3 (e f-d g)}+\frac {b (d+e x) \log \left (c (d+e x)^n\right )}{e g^2}-\frac {f^2 \left (a+b \log \left (c (d+e x)^n\right )\right )}{g^3 (f+g x)}-\frac {b e f^2 n \log (f+g x)}{g^3 (e f-d g)}-\frac {2 f \left (a+b \log \left (c (d+e x)^n\right )\right ) \log \left (\frac {e (f+g x)}{e f-d g}\right )}{g^3}-\frac {2 b f n \operatorname {PolyLog}\left (2,-\frac {g (d+e x)}{e f-d g}\right )}{g^3} \]

[Out]

a*x/g^2-b*n*x/g^2+b*e*f^2*n*ln(e*x+d)/g^3/(-d*g+e*f)+b*(e*x+d)*ln(c*(e*x+d)^n)/e/g^2-f^2*(a+b*ln(c*(e*x+d)^n))
/g^3/(g*x+f)-b*e*f^2*n*ln(g*x+f)/g^3/(-d*g+e*f)-2*f*(a+b*ln(c*(e*x+d)^n))*ln(e*(g*x+f)/(-d*g+e*f))/g^3-2*b*f*n
*polylog(2,-g*(e*x+d)/(-d*g+e*f))/g^3

Rubi [A] (verified)

Time = 0.15 (sec) , antiderivative size = 186, normalized size of antiderivative = 1.00, number of steps used = 12, number of rules used = 10, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.400, Rules used = {45, 2463, 2436, 2332, 2442, 36, 31, 2441, 2440, 2438} \[ \int \frac {x^2 \left (a+b \log \left (c (d+e x)^n\right )\right )}{(f+g x)^2} \, dx=-\frac {f^2 \left (a+b \log \left (c (d+e x)^n\right )\right )}{g^3 (f+g x)}-\frac {2 f \log \left (\frac {e (f+g x)}{e f-d g}\right ) \left (a+b \log \left (c (d+e x)^n\right )\right )}{g^3}+\frac {a x}{g^2}+\frac {b (d+e x) \log \left (c (d+e x)^n\right )}{e g^2}+\frac {b e f^2 n \log (d+e x)}{g^3 (e f-d g)}-\frac {b e f^2 n \log (f+g x)}{g^3 (e f-d g)}-\frac {2 b f n \operatorname {PolyLog}\left (2,-\frac {g (d+e x)}{e f-d g}\right )}{g^3}-\frac {b n x}{g^2} \]

[In]

Int[(x^2*(a + b*Log[c*(d + e*x)^n]))/(f + g*x)^2,x]

[Out]

(a*x)/g^2 - (b*n*x)/g^2 + (b*e*f^2*n*Log[d + e*x])/(g^3*(e*f - d*g)) + (b*(d + e*x)*Log[c*(d + e*x)^n])/(e*g^2
) - (f^2*(a + b*Log[c*(d + e*x)^n]))/(g^3*(f + g*x)) - (b*e*f^2*n*Log[f + g*x])/(g^3*(e*f - d*g)) - (2*f*(a +
b*Log[c*(d + e*x)^n])*Log[(e*(f + g*x))/(e*f - d*g)])/g^3 - (2*b*f*n*PolyLog[2, -((g*(d + e*x))/(e*f - d*g))])
/g^3

Rule 31

Int[((a_) + (b_.)*(x_))^(-1), x_Symbol] :> Simp[Log[RemoveContent[a + b*x, x]]/b, x] /; FreeQ[{a, b}, x]

Rule 36

Int[1/(((a_.) + (b_.)*(x_))*((c_.) + (d_.)*(x_))), x_Symbol] :> Dist[b/(b*c - a*d), Int[1/(a + b*x), x], x] -
Dist[d/(b*c - a*d), Int[1/(c + d*x), x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0]

Rule 45

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d
*x)^n, x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[m, 0] && ( !IntegerQ[n] || (EqQ[c, 0]
&& LeQ[7*m + 4*n + 4, 0]) || LtQ[9*m + 5*(n + 1), 0] || GtQ[m + n + 2, 0])

Rule 2332

Int[Log[(c_.)*(x_)^(n_.)], x_Symbol] :> Simp[x*Log[c*x^n], x] - Simp[n*x, x] /; FreeQ[{c, n}, x]

Rule 2436

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(b_.))^(p_.), x_Symbol] :> Dist[1/e, Subst[Int[(a + b*Log[c*
x^n])^p, x], x, d + e*x], x] /; FreeQ[{a, b, c, d, e, n, p}, x]

Rule 2438

Int[Log[(c_.)*((d_) + (e_.)*(x_)^(n_.))]/(x_), x_Symbol] :> Simp[-PolyLog[2, (-c)*e*x^n]/n, x] /; FreeQ[{c, d,
 e, n}, x] && EqQ[c*d, 1]

Rule 2440

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))]*(b_.))/((f_.) + (g_.)*(x_)), x_Symbol] :> Dist[1/g, Subst[Int[(a +
 b*Log[1 + c*e*(x/g)])/x, x], x, f + g*x], x] /; FreeQ[{a, b, c, d, e, f, g}, x] && NeQ[e*f - d*g, 0] && EqQ[g
 + c*(e*f - d*g), 0]

Rule 2441

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(b_.))/((f_.) + (g_.)*(x_)), x_Symbol] :> Simp[Log[e*((f + g
*x)/(e*f - d*g))]*((a + b*Log[c*(d + e*x)^n])/g), x] - Dist[b*e*(n/g), Int[Log[(e*(f + g*x))/(e*f - d*g)]/(d +
 e*x), x], x] /; FreeQ[{a, b, c, d, e, f, g, n}, x] && NeQ[e*f - d*g, 0]

Rule 2442

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(b_.))*((f_.) + (g_.)*(x_))^(q_.), x_Symbol] :> Simp[(f + g*
x)^(q + 1)*((a + b*Log[c*(d + e*x)^n])/(g*(q + 1))), x] - Dist[b*e*(n/(g*(q + 1))), Int[(f + g*x)^(q + 1)/(d +
 e*x), x], x] /; FreeQ[{a, b, c, d, e, f, g, n, q}, x] && NeQ[e*f - d*g, 0] && NeQ[q, -1]

Rule 2463

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(b_.))^(p_.)*((h_.)*(x_))^(m_.)*((f_) + (g_.)*(x_)^(r_.))^(q
_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*Log[c*(d + e*x)^n])^p, (h*x)^m*(f + g*x^r)^q, x], x] /; FreeQ[{a,
 b, c, d, e, f, g, h, m, n, p, q, r}, x] && IntegerQ[m] && IntegerQ[q]

Rubi steps \begin{align*} \text {integral}& = \int \left (\frac {a+b \log \left (c (d+e x)^n\right )}{g^2}+\frac {f^2 \left (a+b \log \left (c (d+e x)^n\right )\right )}{g^2 (f+g x)^2}-\frac {2 f \left (a+b \log \left (c (d+e x)^n\right )\right )}{g^2 (f+g x)}\right ) \, dx \\ & = \frac {\int \left (a+b \log \left (c (d+e x)^n\right )\right ) \, dx}{g^2}-\frac {(2 f) \int \frac {a+b \log \left (c (d+e x)^n\right )}{f+g x} \, dx}{g^2}+\frac {f^2 \int \frac {a+b \log \left (c (d+e x)^n\right )}{(f+g x)^2} \, dx}{g^2} \\ & = \frac {a x}{g^2}-\frac {f^2 \left (a+b \log \left (c (d+e x)^n\right )\right )}{g^3 (f+g x)}-\frac {2 f \left (a+b \log \left (c (d+e x)^n\right )\right ) \log \left (\frac {e (f+g x)}{e f-d g}\right )}{g^3}+\frac {b \int \log \left (c (d+e x)^n\right ) \, dx}{g^2}+\frac {(2 b e f n) \int \frac {\log \left (\frac {e (f+g x)}{e f-d g}\right )}{d+e x} \, dx}{g^3}+\frac {\left (b e f^2 n\right ) \int \frac {1}{(d+e x) (f+g x)} \, dx}{g^3} \\ & = \frac {a x}{g^2}-\frac {f^2 \left (a+b \log \left (c (d+e x)^n\right )\right )}{g^3 (f+g x)}-\frac {2 f \left (a+b \log \left (c (d+e x)^n\right )\right ) \log \left (\frac {e (f+g x)}{e f-d g}\right )}{g^3}+\frac {b \text {Subst}\left (\int \log \left (c x^n\right ) \, dx,x,d+e x\right )}{e g^2}+\frac {(2 b f n) \text {Subst}\left (\int \frac {\log \left (1+\frac {g x}{e f-d g}\right )}{x} \, dx,x,d+e x\right )}{g^3}+\frac {\left (b e^2 f^2 n\right ) \int \frac {1}{d+e x} \, dx}{g^3 (e f-d g)}-\frac {\left (b e f^2 n\right ) \int \frac {1}{f+g x} \, dx}{g^2 (e f-d g)} \\ & = \frac {a x}{g^2}-\frac {b n x}{g^2}+\frac {b e f^2 n \log (d+e x)}{g^3 (e f-d g)}+\frac {b (d+e x) \log \left (c (d+e x)^n\right )}{e g^2}-\frac {f^2 \left (a+b \log \left (c (d+e x)^n\right )\right )}{g^3 (f+g x)}-\frac {b e f^2 n \log (f+g x)}{g^3 (e f-d g)}-\frac {2 f \left (a+b \log \left (c (d+e x)^n\right )\right ) \log \left (\frac {e (f+g x)}{e f-d g}\right )}{g^3}-\frac {2 b f n \text {Li}_2\left (-\frac {g (d+e x)}{e f-d g}\right )}{g^3} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.09 (sec) , antiderivative size = 153, normalized size of antiderivative = 0.82 \[ \int \frac {x^2 \left (a+b \log \left (c (d+e x)^n\right )\right )}{(f+g x)^2} \, dx=\frac {a g x-b g n x+\frac {b g (d+e x) \log \left (c (d+e x)^n\right )}{e}-\frac {f^2 \left (a+b \log \left (c (d+e x)^n\right )\right )}{f+g x}+\frac {b e f^2 n (\log (d+e x)-\log (f+g x))}{e f-d g}-2 f \left (a+b \log \left (c (d+e x)^n\right )\right ) \log \left (\frac {e (f+g x)}{e f-d g}\right )-2 b f n \operatorname {PolyLog}\left (2,\frac {g (d+e x)}{-e f+d g}\right )}{g^3} \]

[In]

Integrate[(x^2*(a + b*Log[c*(d + e*x)^n]))/(f + g*x)^2,x]

[Out]

(a*g*x - b*g*n*x + (b*g*(d + e*x)*Log[c*(d + e*x)^n])/e - (f^2*(a + b*Log[c*(d + e*x)^n]))/(f + g*x) + (b*e*f^
2*n*(Log[d + e*x] - Log[f + g*x]))/(e*f - d*g) - 2*f*(a + b*Log[c*(d + e*x)^n])*Log[(e*(f + g*x))/(e*f - d*g)]
 - 2*b*f*n*PolyLog[2, (g*(d + e*x))/(-(e*f) + d*g)])/g^3

Maple [C] (warning: unable to verify)

Result contains higher order function than in optimal. Order 9 vs. order 4.

Time = 0.84 (sec) , antiderivative size = 435, normalized size of antiderivative = 2.34

method result size
risch \(\frac {b \ln \left (\left (e x +d \right )^{n}\right ) x}{g^{2}}-\frac {b \ln \left (\left (e x +d \right )^{n}\right ) f^{2}}{g^{3} \left (g x +f \right )}-\frac {2 b \ln \left (\left (e x +d \right )^{n}\right ) f \ln \left (g x +f \right )}{g^{3}}-\frac {b n x}{g^{2}}-\frac {b f n}{g^{3}}+\frac {b e n \,f^{2} \ln \left (g x +f \right )}{g^{3} \left (d g -e f \right )}+\frac {b n \ln \left (\left (g x +f \right ) e +d g -e f \right ) d^{2}}{e g \left (d g -e f \right )}-\frac {b n \ln \left (\left (g x +f \right ) e +d g -e f \right ) d f}{g^{2} \left (d g -e f \right )}-\frac {b e n \ln \left (\left (g x +f \right ) e +d g -e f \right ) f^{2}}{g^{3} \left (d g -e f \right )}+\frac {2 b n f \operatorname {dilog}\left (\frac {\left (g x +f \right ) e +d g -e f}{d g -e f}\right )}{g^{3}}+\frac {2 b n f \ln \left (g x +f \right ) \ln \left (\frac {\left (g x +f \right ) e +d g -e f}{d g -e f}\right )}{g^{3}}+\left (-\frac {i b \pi \,\operatorname {csgn}\left (i c \left (e x +d \right )^{n}\right ) \operatorname {csgn}\left (i c \right ) \operatorname {csgn}\left (i \left (e x +d \right )^{n}\right )}{2}+\frac {i \pi \,\operatorname {csgn}\left (i c \right ) \operatorname {csgn}\left (i c \left (e x +d \right )^{n}\right )^{2} b}{2}+\frac {i \pi \,\operatorname {csgn}\left (i \left (e x +d \right )^{n}\right ) \operatorname {csgn}\left (i c \left (e x +d \right )^{n}\right )^{2} b}{2}-\frac {i \pi \operatorname {csgn}\left (i c \left (e x +d \right )^{n}\right )^{3} b}{2}+b \ln \left (c \right )+a \right ) \left (\frac {x}{g^{2}}-\frac {f^{2}}{g^{3} \left (g x +f \right )}-\frac {2 f \ln \left (g x +f \right )}{g^{3}}\right )\) \(435\)

[In]

int(x^2*(a+b*ln(c*(e*x+d)^n))/(g*x+f)^2,x,method=_RETURNVERBOSE)

[Out]

b*ln((e*x+d)^n)/g^2*x-b*ln((e*x+d)^n)/g^3*f^2/(g*x+f)-2*b*ln((e*x+d)^n)/g^3*f*ln(g*x+f)-b*n*x/g^2-b*f*n/g^3+b*
e*n/g^3*f^2/(d*g-e*f)*ln(g*x+f)+b/e*n/g/(d*g-e*f)*ln((g*x+f)*e+d*g-e*f)*d^2-b*n/g^2/(d*g-e*f)*ln((g*x+f)*e+d*g
-e*f)*d*f-b*e*n/g^3/(d*g-e*f)*ln((g*x+f)*e+d*g-e*f)*f^2+2*b*n/g^3*f*dilog(((g*x+f)*e+d*g-e*f)/(d*g-e*f))+2*b*n
/g^3*f*ln(g*x+f)*ln(((g*x+f)*e+d*g-e*f)/(d*g-e*f))+(-1/2*I*b*Pi*csgn(I*c)*csgn(I*(e*x+d)^n)*csgn(I*c*(e*x+d)^n
)+1/2*I*b*Pi*csgn(I*c)*csgn(I*c*(e*x+d)^n)^2+1/2*I*b*Pi*csgn(I*(e*x+d)^n)*csgn(I*c*(e*x+d)^n)^2-1/2*I*b*Pi*csg
n(I*c*(e*x+d)^n)^3+b*ln(c)+a)*(x/g^2-1/g^3*f^2/(g*x+f)-2/g^3*f*ln(g*x+f))

Fricas [F]

\[ \int \frac {x^2 \left (a+b \log \left (c (d+e x)^n\right )\right )}{(f+g x)^2} \, dx=\int { \frac {{\left (b \log \left ({\left (e x + d\right )}^{n} c\right ) + a\right )} x^{2}}{{\left (g x + f\right )}^{2}} \,d x } \]

[In]

integrate(x^2*(a+b*log(c*(e*x+d)^n))/(g*x+f)^2,x, algorithm="fricas")

[Out]

integral((b*x^2*log((e*x + d)^n*c) + a*x^2)/(g^2*x^2 + 2*f*g*x + f^2), x)

Sympy [F]

\[ \int \frac {x^2 \left (a+b \log \left (c (d+e x)^n\right )\right )}{(f+g x)^2} \, dx=\int \frac {x^{2} \left (a + b \log {\left (c \left (d + e x\right )^{n} \right )}\right )}{\left (f + g x\right )^{2}}\, dx \]

[In]

integrate(x**2*(a+b*ln(c*(e*x+d)**n))/(g*x+f)**2,x)

[Out]

Integral(x**2*(a + b*log(c*(d + e*x)**n))/(f + g*x)**2, x)

Maxima [F]

\[ \int \frac {x^2 \left (a+b \log \left (c (d+e x)^n\right )\right )}{(f+g x)^2} \, dx=\int { \frac {{\left (b \log \left ({\left (e x + d\right )}^{n} c\right ) + a\right )} x^{2}}{{\left (g x + f\right )}^{2}} \,d x } \]

[In]

integrate(x^2*(a+b*log(c*(e*x+d)^n))/(g*x+f)^2,x, algorithm="maxima")

[Out]

-a*(f^2/(g^4*x + f*g^3) - x/g^2 + 2*f*log(g*x + f)/g^3) + b*integrate((x^2*log((e*x + d)^n) + x^2*log(c))/(g^2
*x^2 + 2*f*g*x + f^2), x)

Giac [F]

\[ \int \frac {x^2 \left (a+b \log \left (c (d+e x)^n\right )\right )}{(f+g x)^2} \, dx=\int { \frac {{\left (b \log \left ({\left (e x + d\right )}^{n} c\right ) + a\right )} x^{2}}{{\left (g x + f\right )}^{2}} \,d x } \]

[In]

integrate(x^2*(a+b*log(c*(e*x+d)^n))/(g*x+f)^2,x, algorithm="giac")

[Out]

integrate((b*log((e*x + d)^n*c) + a)*x^2/(g*x + f)^2, x)

Mupad [F(-1)]

Timed out. \[ \int \frac {x^2 \left (a+b \log \left (c (d+e x)^n\right )\right )}{(f+g x)^2} \, dx=\int \frac {x^2\,\left (a+b\,\ln \left (c\,{\left (d+e\,x\right )}^n\right )\right )}{{\left (f+g\,x\right )}^2} \,d x \]

[In]

int((x^2*(a + b*log(c*(d + e*x)^n)))/(f + g*x)^2,x)

[Out]

int((x^2*(a + b*log(c*(d + e*x)^n)))/(f + g*x)^2, x)